CHARTS
Photo by Khadija Yousaf on Unsplash
A wedding gown entails multilayering of expensive specialty fabrics for an outfit
whose useful lifespan may come and go in a single afternoon…
— Mary Roach
Millions of weddings take place every month, and couples across the world find themselves with more and more choices for when, where and how to celebrate their love. The Knot, WeddingWire and Bodas.net teamed up to gather feedback from 20,000 couples in 14 countries to understand how today’s couples are planning their wedding. Let’s explore using a dumbbell chart to illustrate some of the findings.
url_root <- "https://raw.githubusercontent.com/UN-AVT/kamino-source/main/sources/0-shared/data/"
url_file <- "expensive-weddings/expensive-weddings.csv"
url <- paste0(url_root, url_file)
df <- read.csv(url, header = TRUE, stringsAsFactors = FALSE, encoding = "UTF-8")
df
# to make emoji map
# unique(df$Vendor)
df_wo_alcohol <- filter(df, Vendor != "Serve alcohol")
df_segment <- df_wo_alcohol %>%
dplyr::select(Country, Percent) %>%
group_by(Country) %>%
summarise(
min_pt = min(Percent, na.rm = T),
max_pt = max(Percent, na.rm = T)
)
df_segment
theme_opts <- theme(
text = element_text(family = "inconsolata"),
plot.title = element_text(color = "black", size = 14, face = "bold"),
plot.subtitle = element_text(color = "black", size = 12),
plot.caption = element_text(color = "#555555", size = 10, hjust = 1.0, vjust = 1.0),
axis.title.x = element_blank(),
axis.text.x = element_text(size = 12, hjust = 0.5, vjust = 0.5),
axis.text.y = element_text(size = 12, hjust = 1.0, vjust = 0.5),
panel.border = element_blank(),
panel.background=element_rect(fill="#FDFDFD", colour="NA"),
panel.grid.minor = element_blank(), # remove minor gridlines
panel.grid.major = element_line(size = 0.5, linetype = 'dotted', colour = "#999999"),
legend.title = element_blank(), # remove legend title
legend.text = element_text(color = "black", size = 10),
legend.position='bottom',
plot.background = element_rect(fill="#FDFDFD", colour="NA"),
plot.margin = unit(c(0.5, 0.5, 0.5, 0.25), "in")
)
v1 <- ggplot() +
geom_segment(data = df_segment, aes(x = min_pt, xend = max_pt, y = Country, yend = Country), lineend = "butt", linejoin = "round", size=1.0, color="#F44336" ) +
geom_point(data = df_wrangle, aes(x = Percent, y = Country), shape = 21, size = 16, color="black", fill="white", alpha = 0.9 ) +
geom_text(data = df_wrangle, aes(x = Percent, y = Country, label = emoji(Emoji)), size = 9, vjust = 0.25, family="EmojiOne") +
scale_x_continuous(labels=scales::percent_format(scale = 1), sec.axis = dup_axis()) +
coord_cartesian(clip = "off") +
labs(title = "GLOBAL WEDDING REPORT",
subtitle = "percentage reporting, category of expense and serving alcohol",
caption = "Source: the knot, weddingwire, bodas.net",
x = NULL,
y = NULL) +
theme_minimal() +
theme_opts
girafe(ggobj = v1, width_svg = 16, height_svg = 9,
options = list(opts_sizing(rescale = TRUE, width = 1.0)))
@misc{theeconomist_2018_why,
author = {The Economist},
month = {05},
title = {Why expensive weddings are a bad idea},
url = {https://www.economist.com/graphic-detail/2018/05/19/why-expensive-weddings-are-a-bad-idea},
urldate = {2021-02-02},
year = {2018},
organization = {The Economist}
}